package com.hgw.Demo02_FactoryMethod.factory_method;

/**
 * Data time:2021/12/11 21:37
 * StudentID:2019112118
 * Author:hgw
 * Description: 咖啡店
 */
public class CoffeeStore {
    private CoffeeFactory factory;

    public void setFactory(CoffeeFactory factory) {
        this.factory = factory;
    }

    // 点咖啡
    public Coffee orderCoffee() {
        Coffee coffee = factory.createCoffee();
        // 加配料
        coffee.addMilk();
        coffee.addSugar();
        return coffee;
    }
}
